// ==============================================================================================
// RootTreeNode.cs
//
// Created by: NI, 2007.03.26
// Revised by: NI, 2007.11.23
// ==============================================================================================
using System.Windows.Forms;

namespace RibbonExplorer.Tree
{
  // ==============================================================================================
  /// <summary>
  /// This class represents the root node of the tree with its direct child nodes.
  /// </summary>
  // ==============================================================================================
  public class RootTreeNode : TreeNode
  {
    #region Private fields

    private OfficeAppTreeNode _AccessNode;
    private OfficeAppTreeNode _ExcelNode;
    private OfficeAppTreeNode _OutlookNode;
    private OfficeAppTreeNode _PowerPointNode;
    private OfficeAppTreeNode _WordNode;

    #endregion

    #region Lifecycle methods

    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Creates the root node with the specified name.
    /// </summary>
    /// <param name="text">Name of the root tree node.</param>
    // --------------------------------------------------------------------------------------------
    public RootTreeNode(string text)
      : base(text)
    {
      ImageKey = "OfficeApp";
      SelectedImageKey = ImageKey;
      _AccessNode = new AccessTreeNode();
      _ExcelNode = new ExcelTreeNode();
      _OutlookNode = new OutlookTreeNode();
      _PowerPointNode = new PowerPointTreeNode();
      _WordNode = new WordTreeNode();
      Nodes.AddRange(new TreeNode[]
                                 {
                                   _AccessNode,
                                   _ExcelNode,
                                   _OutlookNode,
                                   _PowerPointNode,
                                   _WordNode
                                 });
    }

    #endregion

    #region Public properties

    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Gets the TreeNode representing Access 2007.
    /// </summary>
    // --------------------------------------------------------------------------------------------
    public OfficeAppTreeNode AccessNode
    {
      get { return _AccessNode; }
    }

    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Gets the TreeNode representing Excel 2007.
    /// </summary>
    // --------------------------------------------------------------------------------------------
    public OfficeAppTreeNode ExcelNode
    {
      get { return _ExcelNode; }
    }

    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Gets the TreeNode representing Outlook 2007.
    /// </summary>
    // --------------------------------------------------------------------------------------------
    public OfficeAppTreeNode OutlookNode
    {
      get { return _OutlookNode; }
    }

    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Gets the TreeNode representing PowerPoint 2007.
    /// </summary>
    // --------------------------------------------------------------------------------------------
    public OfficeAppTreeNode PowerPointNode
    {
      get { return _PowerPointNode; }
    }

    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Gets the TreeNode representing Word 2007.
    /// </summary>
    // --------------------------------------------------------------------------------------------
    public OfficeAppTreeNode WordNode
    {
      get { return _WordNode; }
    }

    #endregion
  }
}
